home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 4 #10 / Commodore_Disk_User_Vol.4_10_1991_-.d64 / x-ray files (.txt) < prev   
Commodore BASIC  |  2022-10-26  |  4KB  |  170 lines

  1. 0 rem ***********************
  2. 1 rem ** file xray program **
  3. 2 rem ** copyright (c)1986 **
  4. 3 rem **  esp enterprises  **
  5. 4 rem **   programmed by   **
  6. 5 rem **    paul a eves    **
  7. 6 rem ***********************
  8. 7 rem
  9. 8 rem
  10. 9 rem ***********************
  11. 10 rem ** disable run/stop- **
  12. 11 rem **  restore and list **
  13. 12 rem ** set border/screen **
  14. 13 rem **colours and display**
  15. 14 rem **    main titles    **
  16. 15 rem ***********************
  17. 16 clr:printchr$(142);chr$(8):poke792,193:poke808,234
  18. 17 poke53280,0:poke53281,0:poke646,14:print"[147]";
  19. 18 gosub165
  20. 19 print"        [159]esp enterprises presents"
  21. 20 print"      [154] file x-ray display program"
  22. 21 print"       [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  23. 22 print"   [150][for commodore 64 plus 1541 drive]"
  24. 23 print"[154]         author:   [158]paul a. eves"
  25. 24 print"[154]    re-written :   [158]june '91 for cdu"
  26. 25 print"           any key to continue"
  27. 26 gosub167
  28. 27 wait198,1:poke198,0
  29. 28 print"[147]list directory:-   [yes] [no] or [end]?"
  30. 29 getk$:ifk$<>"y"andk$<>"n"andk$<>"e"then29
  31. 30 ifk$="y"thennf=1:gosub42
  32. 31 ifk$="e"thenprint"[147]":end
  33. 32 nf=0
  34. 33 input"required file:-";n$
  35. 34 iflen(n$)>16thenn$=left$(n$,16)
  36. 35 rem
  37. 36 rem
  38. 37 rem ********************
  39. 38 rem ** read directory **
  40. 39 rem ********************
  41. 40 rem
  42. 41 rem
  43. 42 open15,8,15,"i0":open2,8,2,"#"
  44. 43 tr=18:se=1
  45. 44 print#15,"b-r";2;0;tr;se
  46. 45 print#15,"b-p";2;0
  47. 46 get#2,k$:ifk$=""thenk$=chr$(0)
  48. 47 tr=asc(k$)
  49. 48 get#2,k$:ifk$=""thenk$=chr$(0)
  50. 49 se=asc(k$)
  51. 50 fori=0to7
  52. 51 print#15,"b-p";2;i*32+5
  53. 52 na$=""
  54. 53 forz=0to15
  55. 54 get#2,k$:ifk$=""thenk$=chr$(0)
  56. 55 ifasc(k$)=160then58
  57. 56 na$=na$+k$
  58. 57 nextz
  59. 58 ifn$=na$then68
  60. 59 ifnfthenprintna$
  61. 60 nexti
  62. 61 iftr=0then63
  63. 62 goto44
  64. 63 close2:close15
  65. 64 ifnf<>0then68
  66. 65 ifnf=0thenprint"[150][164][164][164][164][164][164][164][164][157][157][157][157][157][157][157][157]error...[146]  no such file!!!"
  67. 66 print"          any key to continue"
  68. 67 wait198,1:poke198,0:run
  69. 68 ifnfthenreturn
  70. 69 rem
  71. 70 rem
  72. 71 rem ********************
  73. 72 rem **reads and stores**
  74. 73 rem ** parameters of  **
  75. 74 rem ** required file  **
  76. 75 rem ********************
  77. 76 rem
  78. 77 rem
  79. 78 print#15,"b-p";2;i*32+2
  80. 79 get#2,k$:ifk$=""thenk$=chr$(0)
  81. 80 tp=asc(k$)
  82. 81 af=tpand15
  83. 82 ifaf=0thenty$="deleted"
  84. 83 ifaf=1thenty$="sequential"
  85. 84 ifaf=2thenty$="program"
  86. 85 ifaf=3thenty$="user"
  87. 86 ifaf=4thenty$="relative"
  88. 87 ifaf>4thenprint"[150][164][164][164][164][164][164][164][164][157][157][157][157][157][157][157][157]error...[146] file type not recognised!!!":goto66
  89. 88 iftpand128thenxx$="yes":goto90
  90. 89 xx$="no"
  91. 90 iftpand64thense$="yes":goto92
  92. 91 se$="no"
  93. 92 print#15,"b-p"2,i*32+30
  94. 93 get#2,k$:ifk$=""thenk$=chr$(0)
  95. 94 lo=asc(k$)
  96. 95 get#2,k$:ifk$=""thenk$=chr$(0)
  97. 96 hi=asc(k$)*256
  98. 97 bk=lo+hi
  99. 98 ifaf<>4then102
  100. 99 print#15,"b-p";2;i*32+23
  101. 100 get#2,k$:ifk$=""thenk$=chr$(0)
  102. 101 le=asc(k$)
  103. 102 ifaf<>2then117
  104. 103 print#15,"b-p";2;i*32+3
  105. 104 get#2,k$:ifk$=""thenk$=chr$(0)
  106. 105 db=asc(k$)
  107. 106 get#2,k$:ifk$=""thenk$=chr$(0)
  108. 107 df=asc(k$)
  109. 108 open3,8,3,"#"
  110. 109 print#15,"b-r";3;0;db;df
  111. 110 print#15,"b-p";3;2
  112. 111 get#3,k$:ifk$=""thenk$=chr$(0)
  113. 112 lo=asc(k$)
  114. 113 get#3,k$:ifk$=""thenk$=chr$(0)
  115. 114 hi=asc(k$)*256
  116. 115 fa=lo+hi
  117. 116 close3
  118. 117 print#15,"b-r";2;0;18;0
  119. 118 fb=0
  120. 119 forj=4to140step4
  121. 120 ifj=72then124
  122. 121 print#15,"b-p";2;j
  123. 122 get#2,k$:ifk$=""thenk$=chr$(0)
  124. 123 fb=asc(k$)+fb
  125. 124 nextj
  126. 125 ab=664-fb
  127. 126 ifaf<>4then137
  128. 127 sb=bk/121:ifsb<>int(sb)thensb=int(sb+1)
  129. 128 rf=int(((bk-sb)*256)/le)
  130. 129 rem ********************
  131. 130 rem ** asks for output**
  132. 131 rem ** method. screen **
  133. 132 rem ** or printer] and**
  134. 133 rem ** displays info  **
  135. 134 rem ********************
  136. 135 rem
  137. 136 rem
  138. 137 print"[147]output to [screen] or [printer] ?"
  139. 138 getk$:ifk$<>"s"andk$<>"p"then138
  140. 139 ifk$="s"thenopen1,3:print#1,chr$(147):gosub165
  141. 140 ifk$="p"thenopen1,4
  142. 141 print#1,"   program name:       ";n$
  143. 142 print#1:print#1:print#1
  144. 143 print#1,"       -:program parameters:-"
  145. 144 print#1:print#1
  146. 145 print#1,"   type of file:           ";ty$
  147. 146 print#1,"   file closed:            ";xx$
  148. 147 print#1,"   file protected:         ";se$
  149. 148 print#1,"   number of blocks:      ";bk
  150. 149 ifaf<>4then154
  151. 150 print#1,"   record length:         ";le
  152. 151 print#1,"   side-sector blocks:    ";sb
  153. 152 print#1,"   data blocks:           ";bk-sb
  154. 153 print#1,"   records:               ";rf
  155. 154 ifaf=2thenprint#1,"   start address:         ";fa
  156. 155 print#1,"   blocks available[disk]:";fb
  157. 156 print#1,"   blocks allocated[disk]:";ab:print#1:print#1:print#1
  158. 157 close1
  159. 158 print"   re-run program [yes] or [no] ?
  160. 159 [141]167
  161. 160 [160]2:[160]15
  162. 161 [161]k$:[139]k$[178]""[167]161
  163. 162 [139]k$[178]"y"[167][137]0
  164. 163 [139]k$[178]"n"[167][153]"load":[128]
  165. 164 [137]161
  166. 165 [151]53265,[194](53265)[175]239
  167. 166 [142]
  168. 167 [151]53265,[194](53265)[176]16
  169. 168 [142]
  170.